The Alias Manager API now provides the following new
routines:
IsAliasFile
OSErr IsAliasFile(const FSSpec *fileFSSpec,
Boolean *aliasFileFlag,
Boolean *folderFlag);
fileFSSpec
is a pointer to a file
specification record referring to a file.
aliasFileFlag
is a pointer to a Boolean
variable set to true
if the file is an alias file
created by the Finder.
folderFlag
is a pointer to a Boolean
variable set to true
if the alias refers
to folder.
The function IsAliasFile
sets
*aliasFileFlag
to true
if the file
referred to by the fileFSSpec
parameter is an alias
file created by the Finder.
ResolveAliasWithMountFlags
OSErr ResolveAliasWithMountFlags(const FSSpec *fromFile,
AliasHandle alias,
FSSpec *target,
Boolean *wasChanged,
unsigned long mountFlags);
fromFile
, if not NULL
, is
used to resolve relative aliases.
alias
is the AliasHandle
to
resolve.
target
contains a pointer to an
FSSpec
record that will refer to the file or
directory referred to by the alias when the function
completes successfully.
wasChanged
refers to a
Boolean
variable that will be set to true
if the alias record has been modified by
ResolveAliasWithMountFlags
.
mountFlags
can be set to
kResolveAliasFileNoUI
to prevent any user
interaction, including disk switch alerts, while the
alias is being resolved.
The routine ResolveAliasWithMountFlags
is
identical to ResolveAlias
with the exception
that it provides the mountFlags
parameter,
allowing callers to suppress disk switch alerts.
ResolveAliasFileWithMountFlags
OSErr ResolveAliasFileWithMountFlags(FSSpec *theSpec,
Boolean resolveAliasChains,
Boolean *targetIsFolder,
Boolean *wasAliased,
unsigned long mountFlags);
theSpec
on input refers to a
FSSpec
record that refers to an alias file.
If the function completes successfully, it will refer to
the file or the directory that was referred to by the
alias file.
resolveAliasChains
turns on or off
resolution of chains of alias files (for example, an
alias file that refers to an alias file that finally
refers to the target file).
targetIsFolder
points to a
Boolean
variable that will be set to true
if the target referenced by the alias file was found to be a
folder.
wasAliased
returns true
if
theSpec
referred to an alias file.
mountFlags
can be set to
kResolveAliasFileNoUI
to prevent any user
interaction, including disk switch alerts, while the
alias is being resolved.
The routine
ResolveAliasFileWithMountFlags
is identical
to ResolveAliasFile
with the exception that
it provides the mountFlags
parameter,
allowing callers to suppress disk switch alerts.